﻿using BLL;
using System;
using System.Data;
using System.Web.UI.WebControls;

namespace Thksoft.UserCotrols
{
    public partial class TranturnInfo : System.Web.UI.UserControl
    {
        private Lc_TransactionBLL ltb = new Lc_TransactionBLL();
        private Sys_SignatureBLL ssb = new Sys_SignatureBLL();
        private Sys_UserBLL sub = new Sys_UserBLL();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string busId = Request.QueryString["BusinessId"].ToString();

                DataTable dt = ltb.GetTranByBid(decimal.Parse(busId));
                gvwTransDetail.DataSource = dt;
                gvwTransDetail.DataBind();
            }
        }

        public string SysQZ(string signid)
        {
            string url = "~/App_Themes/Images/white.bmp";

            if (string.IsNullOrEmpty(signid))
            {
                DataTable dt = ssb.GetSignatureDataById(decimal.Parse(signid.ToString()));
                if (dt != null && dt.Rows.Count > 0)
                {
                    if (!string.IsNullOrEmpty(dt.Rows[0]["SYSUSERID"].ToString()))
                    {
                        url = dt.Rows[0]["SIGNATUREPATH"].ToString().Replace("..", "~");
                    }
                }
            }

            return url;
        }

        public string GetUserNames(string ids)
        {
            return sub.GetUserNameS(ids);
        }

        protected void gvwTransDetail_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            //if (e.Row.RowType == DataControlRowType.DataRow)
            //{
            //    e.Row.Attributes.Add("onmouseover", "cssd=style.backgroundColor;style.backgroundColor='#d5e7ff'");
            //    e.Row.Attributes.Add("onmouseout", "style.backgroundColor=cssd");
            //}
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
        }
    }
}